package com.siashan.toolkit.sms.core.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 验证码校验结果
 *
 * @author siashan
 * @since v1.0.6
 **/
@Data
@NoArgsConstructor
public class SmsVerifyCheckResult {
    /**
     * 校验结果
     */
    private boolean success;
    /**
     * 结果详情
     */
    private String msg;


    /**
     * 验证码验证通过
     *
     * @return 验证结果
     */
    public static SmsVerifyCheckResult success(){
        return new SmsVerifyCheckResult(true,"短信验证码验证通过");
    }

    /**
     * 验证码验证失败
     *
     * @return 验证结果
     */
    public static SmsVerifyCheckResult fail(){
        return new SmsVerifyCheckResult(false,"短信验证码验证失败");
    }

    /**
     * 验证码验证失败
     *
     * @return 验证结果
     */
    public static SmsVerifyCheckResult empty(){
        return new SmsVerifyCheckResult(false,"短信验证码已过期");
    }

    public SmsVerifyCheckResult(boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }
}
